.class public Les/c7;
.super Ljava/lang/Object;
.source "FrameEncoder.java"


# instance fields
.field private a:I

.field private b:I

.field private c:Ljava/lang/Integer;

.field private d:I

.field private e:Ljava/io/ByteArrayOutputStream;

.field private f:I

.field private g:[Z

.field private h:I

.field private i:I

.field private j:I

.field private k:Z

.field private l:Z


# direct methods
.method public constructor <init>(III)V
    .locals 1

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-object v0, p0, Les/c7;->c:Ljava/lang/Integer;

    const/16 v0, 0x100

    new-array v0, v0, [Z

    .line 3
    iput-object v0, p0, Les/c7;->g:[Z

    const/4 v0, 0x7

    .line 4
    iput v0, p0, Les/c7;->h:I

    const/4 v0, -0x1

    .line 5
    iput v0, p0, Les/c7;->i:I

    const/16 v0, 0x14

    .line 6
    iput v0, p0, Les/c7;->j:I

    const/4 v0, 0x0

    .line 7
    iput-boolean v0, p0, Les/c7;->l:Z

    .line 8
    invoke-virtual {p0, p2, p3}, Les/c7;->a(II)V

    .line 9
    invoke-virtual {p0, p1}, Les/c7;->a(I)V

    return-void
.end method

.method private a([BI)I
    .locals 9

    if-nez p1, :cond_0

    const/4 p1, -0x1

    return p1

    .line 43
    :cond_0
    invoke-static {p2}, Landroid/graphics/Color;->red(I)I

    move-result v0

    .line 44
    invoke-static {p2}, Landroid/graphics/Color;->green(I)I

    move-result v1

    .line 45
    invoke-static {p2}, Landroid/graphics/Color;->blue(I)I

    move-result p2

    const/high16 v2, 0x1000000

    .line 46
    array-length v3, p1

    const/4 v4, 0x0

    const/4 v5, 0x0

    :goto_0
    if-ge v4, v3, :cond_2

    add-int/lit8 v6, v4, 0x1

    .line 47
    aget-byte v4, p1, v4

    and-int/lit16 v4, v4, 0xff

    sub-int v4, v0, v4

    add-int/lit8 v7, v6, 0x1

    .line 48
    aget-byte v6, p1, v6

    and-int/lit16 v6, v6, 0xff

    sub-int v6, v1, v6

    .line 49
    aget-byte v8, p1, v7

    and-int/lit16 v8, v8, 0xff

    sub-int v8, p2, v8

    mul-int v4, v4, v4

    mul-int v6, v6, v6

    add-int/2addr v4, v6

    mul-int v8, v8, v8

    add-int/2addr v4, v8

    .line 50
    div-int/lit8 v6, v7, 0x3

    .line 51
    iget-object v8, p0, Les/c7;->g:[Z

    aget-boolean v8, v8, v6

    if-eqz v8, :cond_1

    if-ge v4, v2, :cond_1

    move v2, v4

    move v5, v6

    :cond_1
    add-int/lit8 v4, v7, 0x1

    goto :goto_0

    :cond_2
    return v5
.end method

.method private a(J)V
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 71
    iget-object v0, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    const/16 v1, 0x21

    invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 72
    iget-object v0, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    const/16 v1, 0xf9

    invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 73
    iget-object v0, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    const/4 v1, 0x4

    invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 74
    iget-object v0, p0, Les/c7;->c:Ljava/lang/Integer;

    const/4 v1, 0x2

    const/4 v2, 0x0

    if-nez v0, :cond_0

    iget-boolean v0, p0, Les/c7;->k:Z

    if-nez v0, :cond_0

    const/4 v0, 0x0

    const/4 v3, 0x0

    goto :goto_0

    :cond_0
    const/4 v0, 0x1

    const/4 v3, 0x2

    .line 75
    :goto_0
    iget v4, p0, Les/c7;->i:I

    if-ltz v4, :cond_1

    and-int/lit8 v3, v4, 0x7

    :cond_1
    shl-int/lit8 v1, v3, 0x2

    .line 76
    iget-object v3, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    or-int/2addr v1, v2

    or-int/2addr v1, v2

    or-int/2addr v0, v1

    invoke-virtual {v3, v0}, Ljava/io/ByteArrayOutputStream;->write(I)V

    long-to-float p1, p1

    const/high16 p2, 0x41200000    # 10.0f

    div-float/2addr p1, p2

    .line 77
    invoke-static {p1}, Ljava/lang/Math;->round(F)I

    move-result p1

    invoke-direct {p0, p1}, Les/c7;->c(I)V

    .line 78
    iget-object p1, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    iget p2, p0, Les/c7;->d:I

    invoke-virtual {p1, p2}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 79
    iget-object p1, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    invoke-virtual {p1, v2}, Ljava/io/ByteArrayOutputStream;->write(I)V

    return-void
.end method

.method private a(Landroid/graphics/Bitmap;)[B
    .locals 10

    .line 52
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v0

    .line 53
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v1

    .line 54
    iget v2, p0, Les/c7;->a:I

    if-ne v0, v2, :cond_0

    iget v2, p0, Les/c7;->b:I

    if-eq v1, v2, :cond_1

    .line 55
    :cond_0
    iget p1, p0, Les/c7;->a:I

    iget v0, p0, Les/c7;->b:I

    sget-object v1, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    invoke-static {p1, v0, v1}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object p1

    .line 56
    new-instance v0, Landroid/graphics/Canvas;

    invoke-direct {v0, p1}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    const/4 v1, 0x0

    const/4 v2, 0x0

    .line 57
    invoke-virtual {v0, p1, v2, v2, v1}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    .line 58
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v0

    .line 59
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v1

    :cond_1
    move-object v2, p1

    move v8, v0

    move v9, v1

    mul-int p1, v8, v9

    .line 60
    new-array v0, p1, [I

    const/4 v4, 0x0

    const/4 v6, 0x0

    const/4 v7, 0x0

    move-object v3, v0

    move v5, v8

    .line 61
    invoke-virtual/range {v2 .. v9}, Landroid/graphics/Bitmap;->getPixels([IIIIIII)V

    mul-int/lit8 v1, p1, 0x3

    .line 62
    new-array v1, v1, [B

    const/4 v2, 0x0

    .line 63
    iput-boolean v2, p0, Les/c7;->k:Z

    const/4 v3, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x0

    :goto_0
    if-ge v3, p1, :cond_3

    .line 64
    aget v6, v0, v3

    if-nez v6, :cond_2

    add-int/lit8 v4, v4, 0x1

    :cond_2
    add-int/lit8 v7, v5, 0x1

    and-int/lit16 v8, v6, 0xff

    int-to-byte v8, v8

    .line 65
    aput-byte v8, v1, v5

    add-int/lit8 v5, v7, 0x1

    shr-int/lit8 v8, v6, 0x8

    and-int/lit16 v8, v8, 0xff

    int-to-byte v8, v8

    .line 66
    aput-byte v8, v1, v7

    add-int/lit8 v7, v5, 0x1

    shr-int/lit8 v6, v6, 0x10

    and-int/lit16 v6, v6, 0xff

    int-to-byte v6, v6

    .line 67
    aput-byte v6, v1, v5

    add-int/lit8 v3, v3, 0x1

    move v5, v7

    goto :goto_0

    :cond_3
    mul-int/lit8 v4, v4, 0x64

    int-to-double v3, v4

    int-to-double v5, p1

    .line 68
    invoke-static {v3, v4}, Ljava/lang/Double;->isNaN(D)Z

    invoke-static {v5, v6}, Ljava/lang/Double;->isNaN(D)Z

    div-double/2addr v3, v5

    const-wide/high16 v5, 0x4010000000000000L    # 4.0

    cmpl-double p1, v3, v5

    if-lez p1, :cond_4

    const/4 v2, 0x1

    .line 69
    :cond_4
    iput-boolean v2, p0, Les/c7;->k:Z

    .line 70
    new-instance p1, Ljava/lang/StringBuilder;

    invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v0, "got pixels for frame with "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1, v3, v4}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;

    const-string v0, "% transparent pixels"

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    const-string v0, "FrameEncoder"

    invoke-static {v0, p1}, Lcom/esfile/screen/recorder/utils/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    return-object v1
.end method

.method private a([B)[[B
    .locals 12
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/esfile/screen/recorder/gif/encoder/utils/CancelledException;
        }
    .end annotation

    .line 23
    array-length v0, p1

    .line 24
    div-int/lit8 v1, v0, 0x3

    .line 25
    new-array v2, v1, [B

    .line 26
    iget v3, p0, Les/c7;->j:I

    invoke-static {p1, v0, v3}, Lcom/esfile/screen/recorder/gif/encoder/utils/b;->a([BII)Lcom/esfile/screen/recorder/gif/encoder/utils/b;

    move-result-object v0

    const/4 v3, 0x2

    new-array v3, v3, [[B

    .line 27
    invoke-virtual {v0}, Lcom/esfile/screen/recorder/gif/encoder/utils/b;->d()[B

    move-result-object v4

    .line 28
    array-length v5, v4

    invoke-static {v4, v5}, Ljava/util/Arrays;->copyOf([BI)[B

    move-result-object v4

    const/4 v5, 0x0

    aput-object v4, v3, v5

    const/4 v6, 0x0

    .line 29
    :goto_0
    array-length v7, v4

    if-ge v6, v7, :cond_0

    .line 30
    aget-byte v7, v4, v6

    add-int/lit8 v8, v6, 0x2

    .line 31
    aget-byte v9, v4, v8

    aput-byte v9, v4, v6

    .line 32
    aput-byte v7, v4, v8

    .line 33
    iget-object v7, p0, Les/c7;->g:[Z

    div-int/lit8 v8, v6, 0x3

    aput-boolean v5, v7, v8

    add-int/lit8 v6, v6, 0x3

    goto :goto_0

    :cond_0
    const/4 v6, 0x0

    const/4 v7, 0x0

    :goto_1
    const/4 v8, 0x1

    if-ge v6, v1, :cond_1

    add-int/lit8 v9, v7, 0x1

    .line 34
    aget-byte v7, p1, v7

    and-int/lit16 v7, v7, 0xff

    add-int/lit8 v10, v9, 0x1

    aget-byte v9, p1, v9

    and-int/lit16 v9, v9, 0xff

    add-int/lit8 v11, v10, 0x1

    aget-byte v10, p1, v10

    and-int/lit16 v10, v10, 0xff

    invoke-virtual {v0, v7, v9, v10}, Lcom/esfile/screen/recorder/gif/encoder/utils/b;->b(III)I

    move-result v7

    .line 35
    iget-object v9, p0, Les/c7;->g:[Z

    aput-boolean v8, v9, v7

    int-to-byte v7, v7

    .line 36
    aput-byte v7, v2, v6

    add-int/lit8 v6, v6, 0x1

    move v7, v11

    goto :goto_1

    :cond_1
    const/16 p1, 0x8

    .line 37
    iput p1, p0, Les/c7;->f:I

    const/4 p1, 0x7

    .line 38
    iput p1, p0, Les/c7;->h:I

    .line 39
    iget-object p1, p0, Les/c7;->c:Ljava/lang/Integer;

    if-eqz p1, :cond_2

    .line 40
    invoke-virtual {p1}, Ljava/lang/Integer;->intValue()I

    move-result p1

    invoke-direct {p0, v4, p1}, Les/c7;->a([BI)I

    move-result p1

    iput p1, p0, Les/c7;->d:I

    goto :goto_2

    .line 41
    :cond_2
    iget-boolean p1, p0, Les/c7;->k:Z

    if-eqz p1, :cond_3

    .line 42
    invoke-direct {p0, v4, v5}, Les/c7;->a([BI)I

    move-result p1

    iput p1, p0, Les/c7;->d:I

    :cond_3
    :goto_2
    aput-object v2, v3, v8

    return-object v3
.end method

.method private b([B)V
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 5
    iget-object v0, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    array-length v1, p1

    const/4 v2, 0x0

    invoke-virtual {v0, p1, v2, v1}, Ljava/io/ByteArrayOutputStream;->write([BII)V

    .line 6
    array-length p1, p1

    rsub-int p1, p1, 0x300

    const/4 v0, 0x0

    :goto_0
    if-ge v0, p1, :cond_0

    .line 7
    iget-object v1, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    invoke-virtual {v1, v2}, Ljava/io/ByteArrayOutputStream;->write(I)V

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_0
    return-void
.end method

.method private c()V
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    iget-object v0, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    const/16 v1, 0x2c

    invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    const/4 v0, 0x0

    .line 2
    invoke-direct {p0, v0}, Les/c7;->c(I)V

    .line 3
    invoke-direct {p0, v0}, Les/c7;->c(I)V

    .line 4
    iget v0, p0, Les/c7;->a:I

    invoke-direct {p0, v0}, Les/c7;->c(I)V

    .line 5
    iget v0, p0, Les/c7;->b:I

    invoke-direct {p0, v0}, Les/c7;->c(I)V

    .line 6
    iget-object v0, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    iget v1, p0, Les/c7;->h:I

    or-int/lit16 v1, v1, 0x80

    invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    return-void
.end method

.method private c(I)V
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 9
    iget-object v0, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    and-int/lit16 v1, p1, 0xff

    invoke-virtual {v0, v1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 10
    iget-object v0, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    shr-int/lit8 p1, p1, 0x8

    and-int/lit16 p1, p1, 0xff

    invoke-virtual {v0, p1}, Ljava/io/ByteArrayOutputStream;->write(I)V

    return-void
.end method

.method private c([B)V
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 7
    new-instance v0, Lcom/esfile/screen/recorder/gif/encoder/utils/a;

    iget v1, p0, Les/c7;->a:I

    iget v2, p0, Les/c7;->b:I

    iget v3, p0, Les/c7;->f:I

    invoke-direct {v0, v1, v2, p1, v3}, Lcom/esfile/screen/recorder/gif/encoder/utils/a;-><init>(II[BI)V

    .line 8
    iget-object p1, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    invoke-virtual {v0, p1}, Lcom/esfile/screen/recorder/gif/encoder/utils/a;->b(Ljava/io/OutputStream;)V

    return-void
.end method


# virtual methods
.method public a()V
    .locals 1

    const/4 v0, 0x1

    .line 80
    iput-boolean v0, p0, Les/c7;->l:Z

    return-void
.end method

.method public a(I)V
    .locals 1

    const/4 v0, 0x1

    if-ge p1, v0, :cond_0

    const/4 p1, 0x1

    .line 17
    :cond_0
    iput p1, p0, Les/c7;->j:I

    return-void
.end method

.method public a(II)V
    .locals 0

    .line 18
    iput p1, p0, Les/c7;->a:I

    .line 19
    iput p2, p0, Les/c7;->b:I

    const/4 p2, 0x1

    if-ge p1, p2, :cond_0

    const/16 p1, 0x140

    .line 20
    iput p1, p0, Les/c7;->a:I

    .line 21
    :cond_0
    iget p1, p0, Les/c7;->b:I

    if-ge p1, p2, :cond_1

    const/16 p1, 0xf0

    .line 22
    iput p1, p0, Les/c7;->b:I

    :cond_1
    return-void
.end method

.method public a(Landroid/graphics/Bitmap;J)Z
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/esfile/screen/recorder/gif/encoder/utils/CancelledException;
        }
    .end annotation

    const/4 v0, 0x0

    if-nez p1, :cond_0

    return v0

    :cond_0
    const/4 v1, 0x1

    .line 1
    :try_start_0
    iget-boolean v2, p0, Les/c7;->l:Z

    if-nez v2, :cond_4

    .line 2
    invoke-direct {p0, p1}, Les/c7;->a(Landroid/graphics/Bitmap;)[B

    move-result-object p1

    .line 3
    iget-boolean v2, p0, Les/c7;->l:Z

    if-nez v2, :cond_3

    .line 4
    invoke-direct {p0, p1}, Les/c7;->a([B)[[B

    move-result-object p1

    .line 5
    aget-object v2, p1, v0

    .line 6
    aget-object p1, p1, v1

    .line 7
    iget-boolean v3, p0, Les/c7;->l:Z

    if-nez v3, :cond_2

    .line 8
    invoke-direct {p0, p2, p3}, Les/c7;->a(J)V

    .line 9
    invoke-direct {p0}, Les/c7;->c()V

    .line 10
    invoke-direct {p0, v2}, Les/c7;->b([B)V

    .line 11
    iget-boolean p2, p0, Les/c7;->l:Z

    if-nez p2, :cond_1

    .line 12
    invoke-direct {p0, p1}, Les/c7;->c([B)V

    const/4 v0, 0x1

    goto :goto_0

    .line 13
    :cond_1
    new-instance p1, Lcom/esfile/screen/recorder/gif/encoder/utils/CancelledException;

    const-string p2, "cancel before writePixels"

    invoke-direct {p1, p2}, Lcom/esfile/screen/recorder/gif/encoder/utils/CancelledException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 14
    :cond_2
    new-instance p1, Lcom/esfile/screen/recorder/gif/encoder/utils/CancelledException;

    const-string p2, "cancel before writeGraphicCtrlExt"

    invoke-direct {p1, p2}, Lcom/esfile/screen/recorder/gif/encoder/utils/CancelledException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 15
    :cond_3
    new-instance p1, Lcom/esfile/screen/recorder/gif/encoder/utils/CancelledException;

    const-string p2, "cancel before analyzePixels"

    invoke-direct {p1, p2}, Lcom/esfile/screen/recorder/gif/encoder/utils/CancelledException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 16
    :cond_4
    new-instance p1, Lcom/esfile/screen/recorder/gif/encoder/utils/CancelledException;

    const-string p2, "cancel before getImagePixels"

    invoke-direct {p1, p2}, Lcom/esfile/screen/recorder/gif/encoder/utils/CancelledException;-><init>(Ljava/lang/String;)V

    throw p1
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    :goto_0
    return v0
.end method

.method public a(Les/b7;)Z
    .locals 6

    .line 81
    iget-wide v0, p1, Les/b7;->b:J

    const/4 v2, 0x1

    const-wide/16 v3, -0x1

    cmp-long v5, v0, v3

    if-nez v5, :cond_0

    .line 82
    iget-object p1, p1, Les/b7;->d:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {p1, v2}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    return v2

    .line 83
    :cond_0
    iget-object v0, p1, Les/b7;->a:Landroid/graphics/Bitmap;

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v0

    iget-object v1, p1, Les/b7;->a:Landroid/graphics/Bitmap;

    invoke-virtual {v1}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v1

    mul-int v0, v0, v1

    invoke-virtual {p0, v0}, Les/c7;->b(I)Z

    .line 84
    iget-object v0, p1, Les/b7;->a:Landroid/graphics/Bitmap;

    iget-wide v3, p1, Les/b7;->b:J

    invoke-virtual {p0, v0, v3, v4}, Les/c7;->a(Landroid/graphics/Bitmap;J)Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-virtual {p0}, Les/c7;->b()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 85
    iget-object v0, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v0

    iput-object v0, p1, Les/b7;->c:[B

    const/4 v0, 0x0

    .line 86
    iput-object v0, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    .line 87
    iget-object v0, p1, Les/b7;->a:Landroid/graphics/Bitmap;

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

    .line 88
    iget-object p1, p1, Les/b7;->d:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {p1, v2}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    return v2

    :cond_1
    const/4 p1, 0x0

    return p1
.end method

.method public b()Z
    .locals 2

    .line 1
    :try_start_0
    iget-object v0, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->flush()V

    .line 2
    iget-object v0, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->close()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    const/4 v0, 0x1

    return v0

    :catch_0
    move-exception v0

    const-string v1, "encode frame failed at finish"

    .line 3
    invoke-static {v1, v0}, Lcom/esfile/screen/recorder/utils/n;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    const/4 v0, 0x0

    return v0
.end method

.method public b(I)Z
    .locals 1

    .line 4
    new-instance v0, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v0, p1}, Ljava/io/ByteArrayOutputStream;-><init>(I)V

    iput-object v0, p0, Les/c7;->e:Ljava/io/ByteArrayOutputStream;

    const/4 p1, 0x1

    return p1
.end method
